package edu.cmu.javadb.plan;

import edu.cmu.javadb.Queryable;
import edu.cmu.javadb.plan.visitor.Visitor;

public class Table extends PlanNode {
	private Queryable<?> table;
	
	public Table(Queryable<?> table) {
		this.table = table;
	}
	
	public Queryable<?> getTable() {
		return table;
	}
	
	@Override
	public String toString() {
		return table + "[" + this.name + "]";
	}
	
	@Override
	public <T> T accept(Visitor<T> visitor) {
		return visitor.visitNode(this);
	}

	@Override
	public <T> void visitChildren(Visitor<T> visitor) {
	
	}

	@Override
	public boolean containsRelation(String name) {
		return getName().equals(name);
	}
}
